﻿using QuartzServices.Domain.Interfaces;

namespace QuartzServices.Infrastructure.UoW
{
    public class UnitOfWork : IUnitOfWork
    {
        private readonly MainDBContext _dbContext;

        public UnitOfWork(MainDBContext dbContext)
        {
            _dbContext = dbContext;
        }

        public async Task<bool> Commit()
        {
            var ret = await _dbContext.SaveChangesAsync();
            return ret > 0;
        }

        public void Dispose()
        {
            _dbContext.Dispose();
        }
    }
}
